cphsoc_write_varlist_html <- function(file,var_labels)
{
  trim <- function(x) {
    gsub('"',"'",gsub('\\s+$|^\\s+','',x))
  }

cat(file=file,
'<table>
  <thead>
    <tr>
      <td>Name</td>
      <td>Label</td>
    </tr>
  </thead>
  <tbody>',paste('    <tr>\n      <td>',names(var_labels),'</td>\n      <td>',trim(var_labels),'</td>\n    </tr>',sep=''),
'  </tbody>
</table>',collapse='\n',sep='\n')
}
